home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20010306-20010921 / 000245_keithuse@synco_pator.com_Thu Jul 5 17:43:32 EDT 2001.msg < prev    next >
Text File  |  2020-01-01  |  5KB  |  139 lines

  1. Article: 12570 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!panix!howland.erols.net!netnews.com!xfer02.netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail
  3. Newsgroups: comp.protocols.kermit.misc
  4. From: keithuse@synco_pator.com (Keith Doyle) 
  5. Subject: Any way to alter Kermit "quit" so I don't have to "kill?"
  6. Reply-To: keithuse@synco_pator.com (Keith Doyle)
  7. Organization: Rexx Electronic Communications
  8. X-Newsreader: trn 4.0-test74 (May 26, 2000)
  9. Lines: 120
  10. Message-ID: <h_417.5247$oa1.534611@newsread1.prod.itd.earthlink.net>
  11. Date: Thu, 05 Jul 2001 21:28:45 GMT
  12. NNTP-Posting-Host: 207.167.89.8
  13. X-Complaints-To: abuse@earthlink.net
  14. X-Trace: newsread1.prod.itd.earthlink.net 994368525 207.167.89.8 (Thu, 05 Jul 2001 14:28:45 PDT)
  15. NNTP-Posting-Date: Thu, 05 Jul 2001 14:28:45 PDT
  16. X-Received-Date: Thu, 05 Jul 2001 14:26:29 PDT (newsmaster1.prod.itd.earthlink.net)
  17. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:12570
  18.  
  19.  
  20.  
  21. Hi,
  22.  
  23. I've been using a dialing program under Linux that will connect
  24. to a shell account and do a bunch of intelligent stuff including
  25. transfer files.  I had been using Zmodem via lrz/lsz with success 
  26. for a long time, but I'm finding it's just not working anymore, 
  27. due to the fact that I can only connect to the target machine now 
  28. via some kind of POP service that uses telnet and is none too
  29. transparent.  It may even be 7 bit, it's not clear, and I have
  30. no control over it.
  31.  
  32. At any rate, I found that I could manually use kermit to perform
  33. a successful transfer.  So I figured the obvious thing to do was to
  34. replace my lrz/lsz logic with C-kermit equivalents.  This worked
  35. fine but with one problem-- after the transfer finished, C-kermit
  36. does something that causes a disconnect.  So, I did some research
  37. on deja/google and found some references to some mention of the
  38. subject in a documentation file somewhere:
  39.  
  40.  
  41. >Many people want to be able to make a dialout connection with UNIX
  42. >C-Kermit, but then use some other software on the connection that C-Kermit
  43. >made.  They quickly find that when they exit from C-Kermit, that the
  44. >connection is gone before they can start the other application.
  45. >
  46. >It is a fundamental property of UNIX that when a process exits, then every
  47. >file that was opened by that process is automatically closed by UNIX.
  48. >Closing a terminal device (such as a dialout tty device) hangs it up.
  49. >There is nothing the process can do about it.
  50. >
  51. >However, many workarounds are possible.  Here are just a few:
  52. >
  53. > . Read about the REDIRECT command in the ckcker.upd file.
  54. >
  55. > . Find out the file descriptor of the open device (it is given by
  56. >   C-Kermit's \v(ttyfd) variable) and then run ("!") your other program
  57. >   from the C-Kermit prompt, feeding it the file descriptor, e.g. through
  58. >   shell redirection or a command line option (the method depends on the
  59. >   other program, the capabilities of the shell, etc).
  60. >
  61. > . After Kermit makes the connection, type "show comm" to find out the
  62. >   filename of the lock file.  Then suspend Kermit, then delete the lock
  63. >   file, then start the other program and tell it to open the same tty
  64. >   device.
  65.  
  66.  
  67. Now my original approach used lrz something like the following:
  68.  
  69.     lrz </dev/modem >/dev/modem
  70.  
  71.  
  72. Since this doesn't hang up the line, I presume that the issue is NOT
  73. "close" of the device.
  74.  
  75. So I tried serveral things.  I noticed that it is possible to pass in
  76. an open file descriptor and have kermit use that.  But, I gathered
  77. you can't just do:
  78.  
  79.     kermit -r -i -l 0 </dev/modem
  80.  
  81.  
  82. As this is only open for input, and kermit is going to need bidirectional
  83. I/O on the FD.  So I tried the following in bash:
  84.  
  85.  
  86.     kermit -r -i -l 3 3<>/dev/modem
  87.  
  88.  
  89. According to the bash spec, this should open descriptor 3 for read/write.
  90. Couldn't get this to work though.
  91.  
  92.  
  93. I then noticed that "modem type" was a setting which included a code
  94. for hangup-- usually ATH0 or something.  Maybe this was the problem I
  95. thought, and did a "set modem none" in the .kermrc to try to circumvent
  96. it.  No effect.
  97.  
  98.  
  99. So lastly, I figured ok, let's see if it really is the close of the
  100. device or something *specific* kermit is doing on exit.  I manually
  101. invoked kermit so that it wouldn't exit, and instead of doing a "quit"
  102. after the transfer, I switched to another window and did a kill -9
  103. on the kermit process.  Voila!  no disconnect occurred.
  104.  
  105. So, I've since implemented a solution to the problem which entails
  106. a kermit script that does something like this:
  107.  
  108.  
  109. set modem none
  110. set line /dev/modem
  111. set file type bin
  112. receive
  113. !/tmp/killkerm
  114.  
  115.  
  116. And invokes kermit like this:
  117.  
  118. echo "kill -9 $$" >/tmp/killkerm
  119. chmod a+x /tmp/killkerm
  120. exec kermit -y kermitscript
  121.  
  122.  
  123.  
  124. And it works like a choim.  However, it is a major kludge.  I'm using
  125. it because it works, but does anyone know how I can get kermit to NOT
  126. do whatever it is doing to the device before it exits so I don't have
  127. use kill?  Perhaps it's doing some kind of rude stty/ioctl that's 
  128. causing it?
  129.  
  130.  
  131.  
  132. --
  133.  
  134. Keith Doyle      <http://www.syncopator.com/carousel>
  135. (to send me an E-letter, remove underbars in reply address)
  136.  
  137. "Simple ain't easy."  -- Thelonious Monk
  138.  
  139.